package com.java.base.exercise.funcationinterface;


import java.util.function.Supplier;

/**
 * java 8 【supplier 数据获取同时有返回值案例的编写】
 */
public class SupplierFunction {

    public static Integer supplierMethod(Supplier<Integer> supplier){
        return supplier.get();
    }


    public static void main(String[] args) {

        int[] intChar={100,68,57,198,32,10};

        Integer restInterge = supplierMethod(() -> {

            int min = intChar[0];
            for (int i : intChar) {
                if (i < min) {
                    min = i;
                }

            }
            return min;
        });

        System.out.println(restInterge);

    }
}
